package com.hsylient.javase.chapter05;

import lombok.SneakyThrows;
import org.junit.Test;

import java.io.BufferedReader;
import java.io.FileReader;

/**
 * 缓冲流
 */
public class H_MyBufferedReader {

    @Test
    @SneakyThrows
    public void testRead() {
        // fileReader叫做节点流
        FileReader fileReader = new FileReader("D:\\IdeaProjects\\logger\\log\\JULCustomProperties.txt");
        // bufferedReader叫做处理流
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        // 一次读一行
        String readLine;
        while ((readLine = bufferedReader.readLine()) != null) {
            System.out.println(readLine);
        }
        bufferedReader.close();
    }
}
